package com.situ.mall.mapper;

import com.situ.mall.pojo.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

@Mapper
public interface UserMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(User record);

    int insertSelective(User record);

    User selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(User record);

    int updateByPrimaryKey(User record);

    List<User> selectAll();

    //查询所有用户
    List queryAllUsers();

    int addUser(Map params);

    int updateUserById(Map params);

    int deleteUser(@Param("id") int id);

    //根据id查询
    User queryUserById(@Param("id") int id);

    //查询用户名是否已经存在
    User queryUserByName(Map params);

    //分页相关数据
    List<User> selectPage(@Param("offset") Integer offset, @Param("limit") Integer limit);

    int selectTotalCount();

    //用于登录操作
    User getUserByUsernameAndPassword(Map params);

    int deleteAll(@Param("array") String[] array);

    /**
     * 获取echarts数据
     */
    List<Map<String, Object>> getEchartsData();
}